/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package search;

import java.util.LinkedList;

/**
 *
 * @author user
 */
public class DFS implements NodeQueue{

    LinkedList<Node> queue = new LinkedList<Node>();

    public Node poll() {
         return queue.removeFirst();
    }

    public void add(Node n) {
        queue.addFirst(n); //<------------------------ only diff from BFS
    }

    public boolean isEmpty() {
        return queue.isEmpty();
    }

    public void clear() {
        queue.clear();
    }

}
